package date1127.bean;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

//定义 Bean 类，实现 ApplicationContextAware 接口
//该类将拥有访问容器的能力
public class Chinese implements ApplicationContextAware {
	// 将 BeanFactory 容器以成员变量保存
	private ApplicationContext applicationContext;

//	创建 bean 实例的 ApplicationContext。此方法由spring调用。
	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
		
	}

	public ApplicationContext getApplicationContext() {
		return applicationContext;
	}
	
}